package com.cloud.drore.eboss.supplier.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.cloud.drore.eboos.common.base.BaseEntity;
import com.cloud.drore.eboos.jackson.JacksonDateDeserializer;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 浙江卓锐科技股份有限公司 版权所有  Copyright 2018<br>
 *
 * @Description: 组合产品关联实体类<br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/1/8 10:36 <br>
 * @Author: <a href="575842778@qq.com">郑永涛</a>
 */
@Data
@Table(name = "eboos_combination_product_relation")
public class CombinationProductRelation extends BaseEntity<Long> {

    /** 组合产品id */
    @JsonProperty("combination_product_id")
    @JSONField(name = "combination_product_id")
    @ApiModelProperty(name = "combination_product_id", notes = "组合产品id", example = "100")
    private Long combinationProductId;

    /** 产品id */
    @JsonProperty("product_id")
    @JSONField(name = "product_id")
    @ApiModelProperty(name = "product_id", notes = "产品id", example = "8")
    private Long productId;

    /** 产品类型  门票产品: TICKET_PRODUCT,组合产品: CONBINATION_PRODUCT,酒店产品:HOTEL */
    @JsonProperty("type")
    @JSONField(name = "type")
    @ApiModelProperty(name = "type", notes = "产品类型", example = "TICKET_PRODUCT,CONBINATION_PRODUCT,HOTEL")
    private String type;

    /** 消费点id */
    @JsonProperty("consume_id")
    @JSONField(name = "consume_id")
    @ApiModelProperty(name = "consume_id", notes = "消费点id", example = "10")
    private Long consumeId;

    /** 结算价 */
    @Transient
    @JsonProperty("settlement_price")
    @JSONField(name = "settlement_price")
    @ApiModelProperty(name = "settlement_price", notes = "结算价", example = "80.00")
    private BigDecimal settlementPrice;

    /** 是否实名制 */
    @Transient
    @JsonProperty("is_real_name")
    @JSONField(name = "is_real_name")
    @ApiModelProperty(name = "is_real_name", notes = "是否实名制(0:是，1:不是)")
    private Integer isRealName;

    /** 产品有效期开始时间 */
    @Transient
    @JsonProperty("term_of_validity_start_time")
    @JsonDeserialize(using = JacksonDateDeserializer.class)
    @JSONField(name = "term_of_validity_start_time",format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "term_of_validity_start_time", notes = "产品有效期开始时间", example = "2018-01-05 00:00:00")
    private Date termOfValidityStartTime;

    /** 产品有效期结束时间 */
    @Transient
    @JsonProperty("term_of_validity_end_time")
    @JsonDeserialize(using = JacksonDateDeserializer.class)
    @JSONField(name = "term_of_validity_end_time",format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "term_of_validity_end_time", notes = "产品有效期结束时间", example = "2018-01-05 00:00:00")
    private Date termOfValidityEndTime;

}